package com.link.base.wechat.wxsubscriber.service;

import com.link.base.wechat.wxsubscriber.model.OpenIdList;
import com.link.base.wechat.wxsubscriber.model.Subscriber;
import com.link.base.wechat.wxsubscriber.model.SubscriberList;
import com.link.core.basic.service.BasicService;

/**
 * 微信公众号用户管理服务
 *
 * @author ouyangzhenqiang
 * @date 2019/03/01 11:16
 */
public interface WxSubscriberService extends BasicService<Subscriber> {

    /**
     * 拉取公众号全部用户openId
     *
     * @author ouyangzhenqiang
     * @date 2019/03/01 14:01
     * @param wx_app_id 微信公众号应用Id
     */
    OpenIdList getAllOpenIdList(String wx_app_id) throws Exception;

    /**
     * 拉取公众号全部用户信息
     *
     * @author ouyangzhenqiang
     * @date 2019/03/01 14:03
     * @param wx_app_id 微信公众号应用Id
     */
    SubscriberList getAllSubscriberList(String wx_app_id) throws Exception;

    /**
     * 批量拉取公众号全部用户信息
     *
     * @author 唐健
     * @date 2020/07/02
     * @param wx_app_id 微信公众号应用Id
     */
    SubscriberList getAllSubscriberListNew(String wx_app_id) throws Exception;

    /**
     * 根据openId拉取用户基本信息
     *
     * @author ouyangzhenqiang
     * @date 2019/03/01 14:02
     * @param wx_app_id 微信公众号应用Id
     * @param openId openId
     */
    Subscriber getSubscriberInfoByOpenId(String wx_app_id, String openId) throws Exception;

    /**
     * 根据openId查找微信用户
     *
     * @author ouyangzhenqiang
     * @date 2019/03/01 14:02
     * @param openId openId
     */
    Subscriber queryByOpenId(String openId) throws Exception;

    /**
     * 新增微信用户
     *
     * @author 欧阳振强
     * @date 2019/03/01 18:02
     * @param subscriber
     */
    void insertSub(Subscriber subscriber) throws Exception;

    /**
     * 更新微信用户
     *
     * @author 欧阳振强
     * @date 2019/03/01 18:02
     * @param subscriber
     */
    void updateSub(Subscriber subscriber) throws Exception;
}
